﻿/* 2014/7/2 */

namespace Cosmos.Media.Play
{
    /// <summary>
    /// Represents attribute of play entity.
    /// </summary>
    public class PlayAttribute
    {
        private IPlayEntity _entity;

        /// <summary>
        /// Initializes an instance of PlayAttribute class with specified name and value.
        /// </summary>
        public PlayAttribute(string name, string value)
        {
            Name = name;
            Value = value;
            Inherited = true;
            AllowMultiple = false;
        }

        /// <summary>
        /// Gets or sets name of this attribute.
        /// </summary>
        public string Name
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets value of this attributes.
        /// </summary>
        public string Value
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets a value which indicates whether this attribute 
        /// can be inherited by sub-nodes of the node to which this attribute
        /// is applied.
        /// </summary>
        public bool Inherited
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets a value which indicates whether multiple instances
        /// of this attribute can existed on a play tree node or play list item.
        /// </summary>
        public bool AllowMultiple
        {
            get;
            set;
        }

        /// <summary>
        /// Gets the play entity which contains this play attribute.
        /// </summary>
        public IPlayEntity Entity
        {
            get
            {
                return _entity;
            }

            internal set
            {
                _entity = value;
            }
        }
    }
}
